; Music of Oriental Games (1990) (Firebird)
; Ripped by Megachur the 15/11/2008

	write "ORIENTAG.BIN"

music_date_rip	equ &0fb8
music_adr	equ &0963
first_theme	equ 1	; 1 -> 1
last_theme	equ 1

	read "music_header_v1_0.asm"

.l0968 equ $ + 5	; sound fx 1 -> 8
.l0966 equ $ + 3
.l0964 equ $ + 1
.l0963
	db #00,#00,#00,#3e,#0c,#00,#06
;
.play_music
;
	di
	push hl
	push de
	push bc
	push af
	ld de,l0968
	ld a,(de)
	or a
	jr z,l09a5
	sla a
	ld l,a
	ld h,#00
	xor a
	ld (de),a
	ld de,l0bfa
	add hl,de
	ld a,(hl)
	inc hl
	ld h,(hl)
	ld l,a
	ld a,(hl)
	ld (l0aa9),a
	inc hl
	ld a,(hl)
	ld (l0aaa),a
	inc hl
	ld a,(hl)
	ld (l0aaf),a
	inc hl
	ld a,(hl)
	ld (l0ab0),a
	inc hl
	ld a,(hl)
	inc hl
	ld h,(hl)
	ld l,a
	ld (l0b77),hl
	ld a,#01
	ld (l0a21),a
.l09a5
	ld hl,l0963
	ld e,(hl)
	bit 7,e
	jr nz,l09c2
	set 7,(hl)
	sla e
	ld d,#00
	ld hl,l0c3a
	add hl,de
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld (l0966),de
	ld (l0a4a),de
.l09c2
	call l09cb
	pop af
	pop bc
	pop de
	pop hl
	ei
	ret
.l09cb
	call l09f0
	ld hl,l0964
	ld a,(hl)
	or a
	jr z,l0a36
	dec a
	or a
	jr z,l0a36
	dec a
	or a
	jr z,l0a36
	dec a
	or a
	jr z,l0a36
	dec a
	or a
	jr z,l0a36
	dec a
	or a
	jr z,l0a36
	dec a
	or a
	jr z,l0a36
	ld (hl),a
	ret
.l09ef
	ld (bc),a
.l09f0
	ld hl,l09ef
	dec (hl)
	jr nz,l0a15
	ld (hl),#02
	ld bc,l0ab1
	ld hl,l0b77
	call l0a22
	ld bc,l0ab2
	ld hl,l0b79
	call l0a22
	ld bc,l0ab3
	ld hl,l0b7b
	call l0a22
	jr l0a1e
.l0a15
	ld a,(l0a21)
	or a
	ret z
	xor a
	ld (l0a21),a
.l0a1e
	jp l0a93
.l0a21
	nop
.l0a22
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld a,d
	or e
	ret z
	inc de
	ld a,(de)
	or a
	jr nz,l0a30
	ld d,a
	ld e,a
	ld (de),a
.l0a30
	ld (hl),d
	dec hl
	ld (hl),e
	ld a,(de)
	ld (bc),a
	ret
.l0a36
	ld a,(l0963)
	and #7f
	ret z
	ld hl,(l0966)
	ld a,(hl)
	cp #ff
	jr nz,l0a86
	inc hl
	ld a,(hl)
	or a
	jr nz,l0a4f
.l0a4a equ $ + 1
	ld hl,l0c3e
	jp l0a8c
.l0a4f
	and #03
	ld c,a
	inc hl
	ld a,c
	or a
	jr z,l0a90
	ld de,l0aab
	dec a
	jr z,l0a60
	ld de,l0aad
.l0a60
	ld a,(hl)
	push hl
	push de
	sub #0c
	ld l,a
	ld h,#00
	add hl,hl
	ld de,l0ab7
	add hl,de
	pop de
	ld a,(hl)
	ld (de),a
	inc hl
	inc de
	ld a,(hl)
	ld (de),a
	ld hl,l0b7d
	ld (l0b79),hl
	ld (l0b7b),hl
	ld a,#01
	ld (l0a21),a
	pop hl
	inc hl
	jr l0a8c
.l0a86
	inc hl
	and #7f
	ld (l0964),a
.l0a8c
	ld (l0966),hl
	ret
.l0a90
	inc hl
	jr l0a8c
.l0a93
	push hl
	ld b,#00
	ld hl,l0aa9
.l0a99
	ld c,(hl)
	inc hl
	ld a,b
	push bc
	call l0bdc
	pop bc
	inc b
	ld a,b
	cp #10
	jr nz,l0a99
	pop hl
	ret
.l0ab0 equ $ + 7
.l0aaf equ $ + 6
.l0aad equ $ + 4
.l0aab equ $ + 2
.l0aaa equ $ + 1
.l0aa9
	db #00,#00,#00,#00,#00,#00,#01,#38
.l0ab3 equ $ + 2
.l0ab2 equ $ + 1
.l0ab1
	db #00,#00,#00,#00,#00,#00
.l0ab7
	dw #0eee,#0e18,#0d4d,#0c8e
	dw #0bda,#0b2f,#0a8f,#09f7
	dw #0968,#08e1,#0861,#07e9
	dw #0777,#070c,#06a7,#0647
	dw #05ed,#0598,#0547,#04fc
	dw #04b4,#0470,#0431,#03f4
	dw #03bc,#0386,#0353,#0324
	dw #02f6,#02cc,#02a4,#027e
	dw #025a,#0238,#0218,#01fa
	dw #01de,#01c3,#01aa,#0192
	dw #017b,#0166,#0152,#013f
	dw #012d,#011c,#010c,#00fd
	dw #00ef,#00e1,#00d5,#00c9
	dw #00be,#00b3,#00a9,#009f
	dw #0096,#008e,#0086,#007f
	dw #0077,#0071,#006a,#0064
	dw #005f,#0059,#0054,#0050
	dw #004b,#0047,#0043,#003f
	dw #003c,#0038,#0035,#0032
	dw #002f,#002d,#002a,#0028
	dw #0026,#0024,#0022,#0020
	dw #001e,#001c,#001b,#0019
	dw #0018,#0016,#0015,#0014
	dw #0013,#0012,#0011,#0010
.l0b7d equ $ + 6
.l0b7b equ $ + 4
.l0b79 equ $ + 2
.l0b77
	db #00,#00,#00,#00,#00,#00,#0a,#0a
	db #09,#09,#08,#08,#07,#07,#06,#06
	db #05,#05,#04,#04,#03,#03,#02,#02
	db #01,#01,#00,#0f,#0e,#0d,#0c,#0b
	db #0a,#09,#08,#07,#06,#05,#04,#03
	db #02,#01,#00,#0a,#0a,#0b,#0b,#0c
	db #0c,#0d,#0d,#0e,#0e,#0f,#0f,#0e
	db #0d,#0c,#0b,#0a,#09,#08,#07,#06
	db #05,#04,#03,#02,#01,#00,#0f,#0f
	db #0e,#0e,#0d,#0d,#0c,#0c,#0b,#0b
	db #0a,#0a,#09,#09,#08,#08,#07,#07
	db #06,#06,#05,#05,#04,#04,#03,#03
	db #02,#02,#01,#01,#00
.l0bdc
	ld b,#f4
	out (c),a
	ld b,#f6
	in a,(c)
	or #c0
	out (c),a
	and #3f
	out (c),a
	ld b,#f4
	out (c),c
	ld b,#f6
	ld c,a
	or #80
	out (c),a
	out (c),c
	ret
.l0bfa
	db #00,#00,#0c,#0c,#12,#0c,#18,#0c
	db #1e,#0c,#24,#0c,#2a,#0c,#30,#0c
	db #36,#0c,#32,#00,#00,#38,#92,#0b
	db #ff,#ff,#ec,#31,#92,#0b,#0a,#00
	db #00,#31,#92,#0b,#2c,#01,#00,#31
	db #92,#0b,#0a,#00,#ff,#31,#92,#0b
	db #0a,#00,#ff,#31,#bd,#0b,#0a,#00
	db #ff,#31,#a2,#0b,#64,#00,#00,#38
.l0c3e equ $ + 4
.l0c3a
	db #a2,#0b,#3e,#0c,#ff,#91,#3f,#ff
	db #92,#52,#c8,#98,#ff,#91,#3d,#b0
	db #ff,#91,#3f,#ff,#92,#50,#b0,#ff
	db #91,#3a,#ff,#92,#52,#e0,#ff,#92
	db #57,#b0,#b0,#ff,#91,#38,#ff,#92
	db #55,#b0,#ff,#91,#3a,#b0,#ff,#91
	db #38,#b0,#ff,#91,#3a,#b0,#ff,#91
	db #38,#e0,#ff,#92,#57,#b0,#b0,#ff
	db #91,#38,#ff,#92,#55,#b0,#ff,#91
	db #3a,#b0,#ff,#91,#38,#b0,#ff,#91
	db #3a,#ff,#92,#57,#b0,#ff,#91,#38
	db #ff,#92,#55,#e0,#ff,#91,#3d,#ff
	db #92,#52,#c8,#98,#ff,#91,#3f,#ff
	db #92,#52,#e0,#ff,#91,#42,#e0,#ff
	db #91,#44,#f8,#98,#b0,#ff,#91,#46
	db #98,#98,#ff,#91,#46,#98,#98,#ff
	db #91,#46,#ff,#92,#3f,#b0,#ff,#91
	db #44,#ff,#92,#3d,#b0,#ff,#91,#46
	db #ff,#92,#3f,#e0,#ff,#91,#4b,#e0
	db #ff,#91,#49,#b0,#b0,#ff,#92,#44
	db #b0,#ff,#92,#42,#b0,#ff,#92,#44
	db #fe,#c2,#ff,#91,#44,#98,#98,#ff
	db #91,#44,#98,#98,#ff,#91,#44,#ff
	db #92,#44,#b0,#ff,#91,#42,#ff,#92
	db #42,#b0,#ff,#91,#44,#ff,#92,#44
	db #e0,#ff,#91,#42,#e0,#ff,#91,#3f
	db #e0,#ff,#91,#42,#ff,#92,#3f,#b0
	db #ff,#92,#3d,#b0,#ff,#91,#44,#ff
	db #92,#3f,#e0,#ff,#91,#46,#c8,#98
	db #ff,#91,#3a,#b0,#b0,#ff,#91,#3a
	db #ff,#92,#52,#b0,#ff,#91,#38,#b0
	db #ff,#91,#3a,#ff,#92,#50,#b0,#ff
	db #91,#3d,#b0,#ff,#91,#3a,#ff,#92
	db #4e,#b0,#ff,#91,#38,#98,#98,#ff
	db #91,#38,#ff,#92,#4b,#fe,#fe,#d4
	db #b0,#ff,#91,#38,#b0,#b0,#ff,#91
	db #38,#ff,#92,#52,#b0,#ff,#91,#36
	db #b0,#ff,#91,#38,#ff,#92,#50,#b0
	db #ff,#91,#3a,#b0,#ff,#91,#38,#ff
	db #92,#4e,#b0,#ff,#91,#36,#b0,#ff
	db #91,#33,#ff,#92,#4b,#fe,#fe,#fe
	db #86,#ff,#91,#3f,#ff,#92,#3f,#e0
	db #ff,#92,#41,#b0,#ff,#91,#3a,#b0
	db #ff,#91,#3f,#ff,#92,#42,#e0,#ff
	db #92,#46,#b0,#ff,#91,#3a,#b0,#ff
	db #91,#38,#ff,#92,#44,#fe,#f2,#b0
	db #ff,#92,#44,#b0,#ff,#91,#33,#ff
	db #92,#42,#b0,#ff,#91,#38,#ff,#92
	db #44,#c8,#98,#ff,#92,#44,#b0,#ff
	db #91,#33,#ff,#92,#42,#b0,#ff,#91
	db #38,#ff,#92,#44,#b0,#ff,#92,#46
	db #b0,#ff,#91,#3a,#ff,#92,#44,#b0
	db #ff,#91,#38,#ff,#92,#42,#b0,#ff
	db #91,#33,#ff,#92,#3f,#fe,#fe,#d4
	db #98,#98,#ff,#91,#33,#ff,#92,#4b
	db #b0,#ff,#92,#49,#b0,#ff,#92,#4b
	db #b0,#ff,#91,#2e,#ff,#92,#4e,#98
	db #98,#ff,#91,#33,#ff,#92,#50,#fe
	db #92,#ff,#91,#36,#98,#98,#ff,#91
	db #38,#ff,#92,#4b,#b0,#ff,#92,#49
	db #b0,#ff,#92,#4b,#98,#98,#ff,#91
	db #33,#ff,#92,#4e,#98,#98,#ff,#91
	db #38,#ff,#92,#50,#fe,#aa,#98,#ff
	db #91,#38,#ff,#92,#4b,#b0,#ff,#92
	db #49,#b0,#ff,#92,#4b,#98,#98,#ff
	db #91,#36,#ff,#92,#4e,#98,#98,#ff
	db #91,#38,#ff,#92,#50,#c8,#98,#ff
	db #91,#3a,#ff,#92,#4e,#b0,#ff,#91
	db #36,#b0,#ff,#91,#33,#ff,#92,#4b
	db #fe,#92,#ff,#91,#31,#ff,#92,#49
	db #b0,#ff,#91,#33,#ff,#92,#4b,#e0
	db #b0,#b0,#ff,#91,#3f,#ff,#92,#4b
	db #c8,#98,#ff,#91,#3f,#ff,#92,#4b
	db #b0,#ff,#91,#3d,#ff,#92,#49,#b0
	db #ff,#91,#3f,#ff,#92,#4b,#b0,#ff
	db #92,#4e,#b0,#ff,#91,#42,#ff,#92
	db #4b,#b0,#ff,#92,#49,#b0,#ff,#91
	db #38,#ff,#92,#4b,#c8,#98,#ff,#92
	db #4b,#b0,#ff,#92,#49,#b0,#ff,#92
	db #4b,#b0,#ff,#92,#4e,#b0,#ff,#92
	db #4b,#b0,#ff,#92,#49,#b0,#ff,#91
	db #38,#ff,#92,#4b,#c8,#98,#ff,#91
	db #38,#ff,#92,#4b,#b0,#ff,#91,#36
	db #ff,#92,#49,#b0,#ff,#91,#38,#ff
	db #92,#4b,#b0,#ff,#92,#4e,#b0,#ff
	db #91,#3a,#ff,#92,#4b,#b0,#ff,#92
	db #49,#b0,#ff,#91,#33,#ff,#92,#4b
	db #c8,#98,#ff,#92,#4b,#b0,#ff,#92
	db #49,#b0,#ff,#92,#4b,#b0,#ff,#92
	db #4e,#b0,#ff,#92,#4b,#b0,#ff,#92
	db #49,#b0,#ff,#92,#49,#ff,#92,#49
	db #ff,#00,#ff
;
.init_music	; added by Megachur
;
	ld (l0963),a
	ret
;
.game_name
	db "Oriental Games",0
.game_year
	db "1990",0
.game_publisher
	db "Firebird",0
.music_author
	db "",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
